<?php
$user = $_SESSION["user"];
if($user){
    echo "<div class='user' >
        <span>欢迎: ". $user["u_login_name"] ."</span>
        <img src=\"/shop/images". $user["u_image_url"] ."\" style=\"width:50px;\"  alt=\"no image\" />
        <a href=\"/shop/shopcart.php\" >购物车</a>
        <a href=\"/shop/myOrder.php\" >我的订单</a>
        <a href=\"/shop/logout.php\" >退出</a>
        <br>
        <a href=\"/shop/index.php\">回首页</a>
    </div>";
} else {
    echo "<div class='user' >
        <a href=\"/shop/loginPage.php\" >去登录</a>
        <a href=\"/shop/registerPage.php\" >去注册</a>
    </div>";
    
    die("<div style='color:red;' >您未登录</div>");
}

?>